/**
 * Copyright 2018 orivil.com. All rights reserved.
 * Use of this source code is governed by a MIT-style
 * license that can be found at https://mit-license.org.
 */

package admin_html

import (
	"gitee.com/tugoer/orivil/mux"
	"gitee.com/tugoer/orivil/export"
	"gitee.com/tugoer/orivil/log"
)

var AdminViewDir = "admin"

var Templates = mux.Template{
	Name: "首页",
	Path: "/admin",
	Dir: AdminViewDir,
	Views:[]string{"layout", "index"},
	Subs: mux.Templates{
		{
			Name: "站点管理",
			Path: "/site",
			Subs: mux.Templates{
				{
					Name:  "地图",
					Path:  "/map",
					Views: []string{"layout", "site-map"},
				},
				{
					Name:  "帐号",
					Path:  "/account",
					Level: 20,
					Subs: mux.Templates{
						{
							Name:  "创建帐号",
							Path:  "/create",
							Views: []string{"layout", "account-create"},
						},
						{
							Name:  "帐号列表",
							Path:  "/list",
							Views: []string{"layout", "account-list"},
						},
					},
				},
			},
		},
	},
}

func init() {
	// 迁移静态文件
	export.ExportFiles(".", "export", log.Info)

	// 静态服务
	mux.HandleStatic("public", "")
}